package com.dp.clone;

public class B implements Cloneable{
	
	public int age;
	
	public A a;

	@Override
	protected B clone() throws CloneNotSupportedException {
		B b=(B)super.clone();//克隆基本数据类型
		b.a=(A)this.a.clone();//克隆引用数据类型
		return b;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public A getA() {
		return a;
	}

	public void setA(A a) {
		this.a = a;
	}

	
}
